package com.ld.common.config;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

// websocket配置，使用内置tomat时，需要增加配置shieldsb.websocket.tomcatEmbed=true
@Configuration
@ConditionalOnProperty(prefix = "shieldsb", name = "websocket.tomcatEmbed", havingValue = "true", matchIfMissing = false)
@Order(3)
public class WebSocketConfig {

    @Bean
    public ServerEndpointExporter serverEndpointExporter() {
        return new ServerEndpointExporter();
    }
}
